<?php
/**
 * Created by PhpStorm.
 * User: root
 * Date: 8/15/14
 * Time: 11:17 AM
 */

namespace Admin\Mapper\Category;

use Base\Mapper\AbstractDbMapper;
use Zend\Stdlib\Hydrator\HydratorInterface as Hydrator;

class AdminCategory extends AbstractDbMapper
{
    protected $tableName = 'categories';

    public function fetchAll()
    {
        $select = $this->getSelect();
        $select->join('category_descriptions' , 'categories.category_id = category_descriptions.category_id' ,array('category_id') , 'left');
        $select->order('categories.category_id DESC');
        $categories = $this->select($select);
        return $categories;
    }

    public function getTableName()
    {
        return $this->tableName;
    }

    public function setTableName($tableName)
    {
        $this->tableName=$tableName;
    }
} 